<template>
  <view class="my-container">
    <!--  -->
    <my-login v-if="!token" style="height: 100%;" :wh='wh'></my-login>
    <my-userinfo v-else></my-userinfo>
  </view>
</template>

<script>
  import badgeMix from '@/mixins/tabbar-badge.js'
  import {
    mapState
  } from 'vuex'
  export default {
    computed: {
      ...mapState('m_user', ['token'])
    },
    mixins: [badgeMix],
    data() {
      return {
        wh: 0,
        coverImgUrl: '', ////////
        title: '',
        singer: '',
        epname: '',
        currentTime: 0,
        duration: 0,
        value: 0,
        now: '00:00',
        VideoContext: {}
      };
    },
    onLoad(option) {
      const sysInfo = uni.getSystemInfoSync()
      this.wh = sysInfo.windowHeight
    },
    onShow() {
      // 当app切到后台再切回前台的时候会触发onShow这个时候视频应该继续播放，不这样做视频会暂停的,。。。。不理解
      // this.$nextTick(() => {
      //   this.VideoContext = uni.createVideoContext('videoRef');
      //   this.VideoContext.play()
      // })
    },
  }
</script>

<style lang="scss">
  page,
  .my-container {
    height: 100%;

    .backgroundimage {
      position: absolute;
      left: 0;
      bottom: 0;
      display: block;
      z-index: -999;
      width: 100%;
      height: 100%;
    }
  }
</style>
